<template>
	<view class="container">
		<view class="bj">
			<view class="title">请选择院区</view>
		</view>
		<!-- 分类列表 -->
		<view class="category-list">
			<view class="aaa" v-for="(row, index) in categoryList" :key="index"
			 @tap="toCategory(row.id)">
				<view class="title1">{{row.state}}</view>
				<view class="bb">
					<image src="../../static/images/register/dingwei.png" class="img">
					</image>
					<view class="text">{{ row.src }}</view>
				</view>
			</view>

		</view>

	</view>

</template>

<script>
	export default {
		data() {
			return {
				categoryList: [],
				
			}
		},
		onLoad() {
			this.getRegister();
			
		},
		methods: {
			// 查询医院列表方法
			getRegister(){
				this.$api.getRegister().then(res => {
				
				console.log('查到的数据:' + JSON.stringify(res));
				this.categoryList=res;
				console.log(this.categoryList)
				
				}).catch(err => {
					// 登录失败
					uni.hideLoading()
					uni.showToast({
						title: '查找失败',
						icon: 'none'
					});
					
				})
			},
			
			toCategory(id) {
				
				uni.navigateTo({
					url: '../cate/cate?id='+id
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.category-list {


		margin-top: -50rpx;

		.aaa {

			position: relative;
			margin-top: 20rpx;
			margin-left: 25rpx;

			width: 700rpx;
			background-color: #F9F9F9;
			border-radius: 10rpx;
			height: 120rpx;

			.title1 {
				display: flex;
				padding-top: 15rpx;
				position: relative;
				margin-left: 20rpx;
				font-size: 30rpx;
			}

			.bb {

				position: relative;

				.img {
					margin-top: 15rpx;
					height: 30rpx;
					width: 30rpx;

					margin-left: 20rpx;
				}

				.text {
					display: flex;

					padding: 10rpx;
					margin-top: -45rpx;
					margin-left: 50rpx;
					font-size: 25rpx;
					color: #3c3c3c;
				}

			}

		}
	}

	.bj {

		position: relative;
		width: 100%;
		height: 180rpx;
		background-color: #44E6DA;

	}

	.title {
		text-align: center;
		padding: 70rpx;
		color: white;
		font-size: 35rpx;
	}
</style>
